# 目标数字
target_number = 7
# 最大次数限制
max_times = 3
# 记录已经猜了多少次
guess_numer = 0
while guess_numer < max_times:
    guess_input = int(input("请输入您要猜的数字："))
    guess_numer += 1
    if guess_input == target_number:
        print("恭喜你猜中了")
        break
else:
    print("抱歉，你输了")
print("游戏结束")